package com.lzh.controller;

import com.lzh.pojo.repVo.BaseResp;
import com.lzh.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author Li
 * @ 2022/3/28
 */
@RequestMapping("pay")
@RestController
public class PayController {
    @Autowired
    PayService payservice ;

    @RequestMapping("/buyTicket")
    public BaseResp buyTicket(@RequestBody Map map){
        return payservice.pay(map) ;
    }

    @RequestMapping("/travelPay")
    public BaseResp travelPay(@RequestBody Map map){
        return payservice.travelPay(map) ;
    }

    @RequestMapping("/notifyResult")
    public void notifyResult(HttpServletRequest request){
        payservice.notifyResult(request) ;
    }

    @RequestMapping("/refundTicket")
    public BaseResp refundTicket(@RequestBody Map map) {
        return payservice.refundTicket(map) ;
    }
}